<!-- Left logo -->
<?php
if (session('userInfo')['type'] == 1) {
?>
<aside class="main-sidebar">
    <section class="sidebar">
        <!-- 导航页面 -->
        <ul class="sidebar-menu">


            <li class="<?php echo CONTROLLER_NAME == 'Index' ? 'active' : ''; ?> treeview">
                <a href="{:U('Qgs/index/index')}">
                    <i class="fa fa-dashboard"></i> <span>后台首页</span>
                </a>
            </li>

            <li class="treeview <?php echo CONTROLLER_NAME == 'Purchase' ? 'active' : ''; ?>">
                <a href="javascript:;">
                    <i class="fa fa-th"></i> <span>采购</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li class="<if condition='ACTION_NAME eq index'>active</if>"><a href="{:U('Purchase/index')}"><i class="fa fa-circle-o"></i> 采购商品列表</a></li>
                    <li class="<if condition='ACTION_NAME eq shoppingCart'>active</if>"><a href="{:U('Purchase/shoppingCart')}"><i class="fa fa-circle-o"></i> 我的采购计划</a></li>
                    <li class="<if condition='ACTION_NAME eq shoppingList'>active</if>"><a href="{:U('Purchase/shoppingList')}"><i class="fa fa-circle-o"></i> 我的采购单</a></li>
                </ul>
            </li>
            <li class="<?php echo  CONTROLLER_NAME == 'Page' || CONTROLLER_NAME == 'ShortcutMenu' || CONTROLLER_NAME == 'Carousel' || CONTROLLER_NAME == 'Search' ? 'active' : ''; ?>">
                <a href="javascript:;">
                    <i class="fa fa-th"></i> <span>首页管理</span>
                    <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="/Qgs/carousel/index"><i class="fa fa-circle-o"></i> 轮播图管理</a></li>
                    <li><a href="/Qgs/ShortcutMenu/index"><i class="fa fa-circle-o"></i> 图标栏目管理</a></li>
                    <li><a href="/Qgs/Page/index"><i class="fa fa-circle-o"></i> 首页促销</a></li>
                    <li><a href="/Qgs/Page/recommend"><i class="fa fa-circle-o"></i> 商品推荐</a></li>
                    <li><a href="{:U('Search/index')}"><i class="fa fa-circle-o"></i> 搜索关键字</a></li>
                    <li><a href="{:U('Artice/index')}"><i class="fa fa-circle-o"></i> 文章管理</a></li>
                </ul>
            </li>
            <li class="<?php echo  CONTROLLER_NAME == 'Weixin'  ? 'active' : ''; ?>">
                <a href="javascript:;">
                    <i class="fa fa-th"></i> <span>微信设置</span>
                    <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
                </a>
                <ul class="treeview-menu">
                    <li class="<if condition='CONTROLLER_NAME eq index'>active</if>"><a href="/Qgs/Weixin/index"><i class="fa fa-circle-o"></i> 微信消息模板</a></li>
                </ul>
            </li>
            <li class="<?php echo  CONTROLLER_NAME == 'Letter'  ? 'active' : ''; ?>">
                <a href="javascript:;">
                    <i class="fa fa-th"></i> <span>短信设置</span>
                    <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
                </a>
                <ul class="treeview-menu">
                    <li class="<if condition='CONTROLLER_NAME eq index'>active</if>"><a href="/Qgs/Letter/index"><i class="fa fa-circle-o"></i> 短信模板</a></li>
                </ul>
            </li>
            <li class="treeview <?php echo CONTROLLER_NAME == 'Label' || CONTROLLER_NAME == 'StoreGoods' || CONTROLLER_NAME == 'StoreCat' || CONTROLLER_NAME == 'StoreDot' || CONTROLLER_NAME == 'Store' ? 'active' : ''; ?>">
                <a href="javascript:;">
                    <i class="fa fa-laptop"></i>
                    <span>商品管理</span>
                    <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="{:U('/Qgs/StoreCat/index')}"><i class="fa fa-circle-o"></i> 商品分类</a></li>
                    <li><a href="{:U('/Qgs/StoreGoods/index')}"><i class="fa fa-circle-o"></i> 商品配置</a></li>
                    <li><a href="{:U('/Qgs/StoreGoods/putaway')}"><i class="fa fa-circle-o"></i> 上架商品管理</a></li>
                    <li><a href="{:U('/Qgs/Label/index')}"><i class="fa fa-circle-o"></i> 商品标签</a></li>
                </ul>
            </li>
            <li class="treeview <?php echo CONTROLLER_NAME == 'Rbac' ? 'active' : ''; ?>">
                <a href="javascript:;">
                    <i class="fa fa-edit"></i> <span>权限设置</span>
                    <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="{:U('Qgs/Rbac/user')}"><i class="fa fa-circle-o"></i> 账号</a></li>
                    <li><a href="{:U('Qgs/Rbac/role')}"><i class="fa fa-circle-o"></i> 角色</a></li>
                    <li><a href="{:U('Qgs/Rbac/menu')}"><i class="fa fa-circle-o"></i> 菜单</a></li>
                </ul>
            </li>
            <li class="treeview <if condition='CONTROLLER_NAME eq Orders'>active</if>">
                <a href="javascript:;">
                    <i class="fa fa-table"></i> <span>订单</span>
                    <span class="pull-right-container">
                      <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="{:U('Orders/orderList')}"><i class="fa fa-circle-o"></i> 订单列表</a></li>
                </ul>
            </li>
            <!--<li class="treeview <if condition='CONTROLLER_NAME eq Count'>active</if>">
                <a href="javascript:;">
                    <i class="fa fa-calendar"></i> <span>统计</span>
                    <span class="pull-right-container">
                       <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li><a href="{:U('Qgs/Count/user')}"><i class="fa fa-circle-o"></i> 会员统计</a></li>
                    <li><a href="#"><i class="fa fa-circle-o"></i> 订单销售统计</a></li>
                    <li><a href="#"><i class="fa fa-circle-o"></i> 商品销售</a></li>
                    <li><a href="#"><i class="fa fa-circle-o"></i> 物流统计</a></li>
                    <li><a href="#"><i class="fa fa-circle-o"></i> 退款统计</a></li>
                </ul>
            </li>-->

            <li class="treeview <if condition='CONTROLLER_NAME eq Giftcode or CONTROLLER_NAME eq OrderPromotion or CONTROLLER_NAME eq Promotion or CONTROLLER_NAME eq DiscountCoupon or CONTROLLER_NAME eq Flashsales'>active</if>">
                <a href="javascript:;">
                    <i class="fa fa-envelope"></i> <span>营销</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a> 
                <ul class="treeview-menu">
                    <li class="<if condition='CONTROLLER_NAME eq DiscountCoupon'>active</if>"><a href="{:U('DiscountCoupon/index')}"><i class="fa fa-circle-o"></i> 优惠券</a></li>
                    <li class="<if condition='CONTROLLER_NAME eq GoodsPromotion'>active</if>"><a href="{:U('GoodsPromotion/index')}"><i class="fa fa-circle-o"></i> 商品促销</a></li>
                    <li class="<if condition='CONTROLLER_NAME eq OrderPromotion'>active</if>"><a href="{:U('OrderPromotion/index')}"><i class="fa fa-circle-o"></i> 订单促销</a></li>
                    <li class="<if condition='ACTION_NAME eq group'>active</if>"><a href="{:U('Promotion/group')}"><i class="fa fa-circle-o"></i> 组合促销</a></li>
                    <li class="<if condition='CONTROLLER_NAME eq Flashsales'>active</if>"><a href="{:U('Flashsales/index')}"><i class="fa fa-circle-o"></i> 限时抢购</a></li>
                    <li class="<if condition='CONTROLLER_NAME eq Giftcode'>active</if>"><a href="{:U('Giftcode/index')}"><i class="fa fa-circle-o"></i> 领券中心</a></li>
                    <!--<li><a href="pages/tables/simple.html"><i class="fa fa-circle-o"></i> 商品发现</a></li>-->
                </ul>                
            </li>
            <li class="treeview <if condition='CONTROLLER_NAME eq Special'>active</if>">
                <a href="javascript:;">
                    <i class="fa fa-envelope"></i> <span>活动专题</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a> 
                <ul class="treeview-menu">
                    <li class="<if condition='ACTION_NAME eq index or ACTION_NAME eq template'>active</if>"><a href="{:U('special/index')}"><i class="fa fa-circle-o"></i> 专题列表</a></li>
                    <li class="<if condition='ACTION_NAME eq cart'>active</if>"><a href="{:U('special/advert')}"><i class="fa fa-circle-o"></i> 专题广告</a></li>
                    <li class="<if condition='ACTION_NAME eq cart'>active</if>"><a href="{:U('special/cart')}"><i class="fa fa-circle-o"></i> 专题商品包</a></li>
                </ul>
            </li>
            <li class="treeview <if condition='CONTROLLER_NAME eq Supplier'>active</if>">
                <a href="javascript:;">
                    <i class="fa fa-envelope"></i> <span>供应商管理</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li class="<if condition='ACTION_NAME eq index'>active</if>"><a href="{:U('Supplier/index')}"><i class="fa fa-circle-o"></i> 供应商列表</a></li>
                    </ul>

            </li>
            <li class="treeview <if condition='CONTROLLER_NAME eq Storesetup or CONTROLLER_NAME eq Freight  or CONTROLLER_NAME eq SetCommission or CONTROLLER_NAME eq Delivery  or CONTROLLER_NAME eq Dlycorp or CONTROLLER_NAME eq StoreSetup'>active</if>">
                <a href="javascript:;">
                    <i class="fa fa-envelope"></i> <span>店铺配置</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li class="<if condition='ACTION_NAME eq dlytmp'>active</if>"><a href="{:U('freight/dlytmp')}"><i class="fa fa-circle-o"></i> 快递运费模板</a></li>
                    <li class="<if condition='ACTION_NAME eq dlyyctmp'>active</if>"><a href="{:U('freight/dlyyctmp')}"><i class="fa fa-circle-o"></i> 店铺运费模板</a></li>
                    <li class="<if condition='ACTION_NAME eq setCommission'>active</if>"><a href="{:U('SetCommission/setCommission')}"><i class="fa fa-circle-o"></i> 佣金设置</a></li>
                    <li class="<if condition='ACTION_NAME eq dlycorp'>active</if>"><a href="{:U('Dlycorp/dlycorp')}"><i class="fa fa-circle-o"></i>
                         物流公司</a></li>
                    <li class="<if condition='ACTION_NAME eq deliveryInfo'>active</if>"><a href="{:U('Delivery/deliveryInfo')}"><i class="fa fa-circle-o"></i> 发货信息管理</a></li>
                    <li class="<if condition='ACTION_NAME eq printer'>active</if>"><a href="{:U('Delivery/printer')}"><i class="fa fa-circle-o"></i> 快递单模板</a></li>
                    <li class="<if condition='CONTROLLER_NAME eq Storesetup'>active</if>"><a href="{:U('Storesetup/index')}"><i class="fa fa-circle-o"></i> 店铺基础信息</a></li>
                    <li><a href="{:U('/Qgs/StoreDot/index')}"><i class="fa fa-circle-o"></i> 自提点管理</a></li>
                </ul>
            </li>
            <li class="treeview <if condition='CONTROLLER_NAME eq Refund or CONTROLLER_NAME eq Feedback'>active</if>">
                <a href="javascript:;">
                    <i class="fa fa-folder"></i> <span>售后</span>
                    <span class="pull-right-container">
                      <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li class="<if condition='ACTION_NAME eq index'>active</if>"><a href="{:U('Refund/index',array('view'=>1))}"><i class="fa fa-circle-o"></i> 退款退货</a></li>
                    <li><a href="{:U('MemberComplain/index')}"><i class="fa fa-circle-o"></i> 投诉</a></li>
                </ul>
            </li>
            <li class="treeview <if condition='CONTROLLER_NAME eq User or CONTROLLER_NAME eq index'>active</if>">
                <a href="javascript:;">
                    <i class="fa fa-share"></i> <span>会员</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li class="<if condition='ACTION_NAME eq index'>active</if>"><a href="{:U('User/index')}"><i class="fa fa-circle-o"></i> 会员列表</a></li>
                    <li class="<if condition='ACTION_NAME eq tempUser'>active</if>"><a href="{:U('User/tempUser')}"><i class="fa fa-circle-o"></i> 游客列表</a></li>
                </ul>
            </li>
            <li class="treeview <if condition='CONTROLLER_NAME eq Distribution'>active</if>">
                <a href="javascript:;">
                    <i class="fa fa-envelope"></i> <span>分销</span>
                    <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                    </span>
                </a>
                <ul class="treeview-menu">
                    <li class="<if condition='ACTION_NAME eq setMoney'>active</if>"><a href="{:U('Distribution/setMoney')}"><i class="fa fa-circle-o"></i> 奖金配置</a></li>
                    <li class="<if condition='ACTION_NAME eq memberList'>active</if>"><a href="{:U('Distribution/memberList')}"><i class="fa fa-circle-o"></i> 分销人员列表</a></li>
                </ul>
            </li>
            <li class="header">备注</li>
            <li class="treeview <if condition='CONTROLLER_NAME eq Bills or CONTROLLER_NAME eq index'>active</if>">
                <a href="{:U('Bills/index')}"><i class="fa fa-circle-o text-red"></i> <span>结算账单</span></a>
            </li>
            <li class="treeview <if condition='CONTROLLER_NAME eq QgsBills or CONTROLLER_NAME eq index'>active</if>">
                <a href="{:U('QgsBills/index')}"><i class="fa fa-circle-o text-red"></i> <span>全国送抽佣账单</span></a>
            </li>
            <li class="treeview <if condition='CONTROLLER_NAME eq Identity or CONTROLLER_NAME eq index'>active</if>">
                <a href="{:U('Identity/index')}"><i class="fa fa-circle-o text-red"></i> <span>身份证信息审核</span></a>
            </li>
        </ul>
    </section>
    <!-- /.sidebar -->
</aside>

<?php
}elseif(session('userInfo')['type'] == 2){

?>

<aside class="main-sidebar">
    <section class="sidebar">
        <!-- 导航页面 -->
        <ul class="sidebar-menu">

<?php
    foreach ($nav_menu as $k=>$v) {
            switch ($k)
            {
                case 0:
                    $iClass = 'fa-dashboard';
                    break;
                case 1:
                    $iClass = 'fa-th';
                    break;
                case 2:
                    $iClass = 'fa-laptop';
                    break;
                case 3:
                    $iClass = 'fa-edit';
                    break;
                case 4:
                    $iClass = 'fa-table';
                    break;
                case 5:
                    $iClass = 'fa-folder';
                    break;
                default:
                    $iClass = 'fa-dashboard';
            }

?>
            <li class="treeview">
                <a href="#">
                    <i class="fa <?php echo $iClass; ?>"></i> <span><?php echo $v['name'];?></span>
                    <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
                </a>
                <ul class="treeview-menu">
                    <?php
                    foreach ($menu as $value) {
                        if($v['id'] == $value['nav_menu_id']) {
                    ?>
                    <li><a href="<?php echo $value['value']; ?>"><i class="fa fa-circle-o"></i> <?php echo $value['name']?></a></li>
                    <?php }} ?>
                </ul>
            </li>
<?php }  ?>
        </ul>
        <script type="text/javascript">
			var curHref = window.location.href.toLowerCase();
			$(".sidebar-menu .treeview-menu a").each(function(){
				if(curHref.indexOf($(this).attr("href").toLowerCase()) != -1){
					$(this).parents(".treeview").addClass("active");
					$(this).parent().addClass("active");
				}	
			});
		</script>
    </section>
    <!-- /.sidebar -->
</aside>
<?php } ?>